// 启动 npm nodemon xxx.js  自动运行修改的文件
// class 对象
class Person {
  constructor(val) {
    this.value = val
  }
  getValue() {
    console.log('getValue', this)
    return this.value
  }
  static create(value) {
    return new Person(value)
  }
}

let person = new Person('joe')
// console.log(person)
console.log(person.getValue())
let perSta = Person.create('lzc')
console.log(perSta.getValue())

class Student extends Person {
  constructor(name, number) {
    // 调用它，相当于调用了父类的构造函数
    super(name)
    this.number = number
  }
}
